﻿
@{
    ViewBag.Title = "SystemRoleList";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}
@section css {
    <link href="~/Assets/css/lib/bootstrap-select.css" rel="stylesheet" />
    <style>
        th {
            text-align: center;
            font-weight: bold;
        }

        td {
            text-align: center;
            vertical-align: middle;
        }
    </style>
}
<div class="page-content" ng-cloak ng-controller="OrganizationController" ng-init="page='@(Request.QueryString["page"].IsEmpty() ? "1" : Request.QueryString["page"])';
         SearchModel={};
         GetRolePageList(SearchModel,page);">
    <div class="page-heading">
        <h1>角色管理</h1>
        <div class="options">
            <div class="btn-toolbar">

            </div>
        </div>
    </div>
    <ol class="breadcrumb">
        <li><a>主页</a></li>
        <li><a>组织架构</a></li>
        <li class="active"><a>角色管理</a></li>
    </ol>

    <div class="container-fluid">
        <div class="row">
            <div class="col-md-12">
                <div class="panel panel-default">
                    <div class="panel-heading"><h2>过滤</h2></div>
                    <div class="panel-body">
                        <div class="col-md-2">
                            <input type="text" class="form-control" placeholder="角色名称" ng-model="SearchModel.Text" ng-change="GetRolePageList(SearchModel,1);" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="panel panel-sky">
                    <div class="panel-heading">
                        <h2>角色</h2>
                        <div class="panel-ctrls">
                            <div class="btn-group">
                                <a  href="SystemRoleAdd?page={{page}}" class="btn btn-xs btn-inverse"><i class="fa fa-plus"></i>添加角色</a>
                            </div>
                        </div>
                    </div>
                    <div class="panel-body  panel-no-padding">
                        <div class="text-center" ng-show="PageLoading">
                            <img src="~/Assets/img/loading.gif" />
                        </div>
                        <table class="table table-striped table-bordered" ng-show="!PageLoading">
                            <thead>
                                <tr>
                                    <th style="width:5%">序号</th>
                                    <th style="width:15%">角色名称</th>
                                    <th style="width:10%">超管权限</th>
                                    <th style="width:10%">公司领导权限</th>
                                    <th style="width:10%">部门领导权限</th>
                                    <th style="width:20%">备注</th>
                                    <th style="width:10%">创建时间</th>
                                    <th style="width:15%">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr ng-show="RoleList==null || RoleList.length==0">
                                    <td colspan="8" style="text-align:center;vertical-align:middle;line-height:30px;">没有数据</td>
                                </tr>
                                <tr ng-repeat="x in RoleList" ng-show="RoleList!=null && RoleList.length>0">
                                    <td ng-bind="$index+1"></td>
                                    <td ng-bind="x.RoleName"></td>
                                    <td><span class="label label-info" ng-show="x.IsAdmin">是</span><span class="label label-default" ng-show="!x.IsAdmin">否</span></td>
                                    <td><span class="label label-info" ng-show="x.IsLeader">是</span><span class="label label-default" ng-show="!x.IsLeader">否</span></td>
                                    <td><span class="label label-info" ng-show="x.IsDepartmentLeader">是</span><span class="label label-default" ng-show="!x.IsDepartmentLeader">否</span></td>
                                    <td ng-bind="x.Description"></td>
                                    <td ng-bind="x.CreateTime|JSONDate:'yyyy-MM-dd HH:mm'"></td>
                                    <td>
                                        <a ng-show="1==1" href="SystemRoleEdit?Id={{x.Id}}&page={{page}}" class="btn btn-warning btn-xs btn-label"><i class="fa fa-pencil"></i>编辑</a>
                                        <a ng-show="1==1" href="#" class="btn btn-danger btn-xs btn-label"><i class="fa fa-trash-o"></i>删除</a>
                                    </td>
                                </tr>
                            </tbody>
                        </table>

                    </div>

                </div>
                <div class="text-center" ng-show="RoleList!=null && RoleList.length>0">
                    <ul class="pagination  justify-content-center">
                        <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetRolePageList(SearchModel,1);">首页</a></li>
                        <li class="page-item" ng-class="{'active':result.currentPage==page}" ng-repeat="page in result.pages"><a style="cursor:pointer;" ng-click="GetRolePageList(SearchModel,page)" class="page-link" ng-bind="page"></a></li>
                        <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetRolePageList(SearchModel,(result.currentPage + 1 > result.totalPage ? result.totalPage : result.currentPage + 1))">下一页</a></li>
                        <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetRolePageList(SearchModel,result.totalPage);">尾页</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>

@section Js{
    <script src="~/Assets/js/pg/Organization.js"></script>
}
